package com.springboot.ww.platform.pd.lms.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.springboot.ww.platform.pd.lms.api.PddCommonDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2024-07-23 14:58
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@NoArgsConstructor
@Data
public class PdCreateChartsDTO extends PddCommonDTO {

    @JsonProperty("catId")
    private Long catId;
    @JsonProperty("classId")
    private Integer classId;
    @JsonProperty("content")
    private ContentDTO content;
    @JsonProperty("name")
    private String name;
    @JsonProperty("operatorId")
    private Integer operatorId;
    @JsonProperty("operatorName")
    private String operatorName;
    @JsonProperty("operatorType")
    private Integer operatorType;
    @JsonProperty("reusable")
    private Boolean reusable;

    @NoArgsConstructor
    @Data
    public static class ContentDTO {
        private Integer generalSizeType;
        private Integer localSizeSource;
        @JsonProperty("meta")
        private MetaDTO meta;
        @JsonProperty("records")
        private List<RecordsDTO> records;

        @NoArgsConstructor
        @Data
        public static class MetaDTO {
            @JsonProperty("elementList")
            private List<ElementListDTO> elementList;
            @JsonProperty("groupList")
            private List<GroupListDTO> groupList;

            @NoArgsConstructor
            @Data
            public static class ElementListDTO {
                @JsonProperty("id")
                private Integer id;
                @JsonProperty("name")
                private String name;
            }

            @NoArgsConstructor
            @Data
            public static class GroupListDTO {
                @JsonProperty("id")
                private Integer id;
                @JsonProperty("name")
                private String name;
            }
        }

        @NoArgsConstructor
        @Data
        public static class RecordsDTO {
            private Map<String,String> values;
        }
    }
}
